home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
music4c.sit
/
Music4C Folder
/
SFConvert folder
/
SFConverttools.c
< prev
next >
Wrap
Text File
|
1990-06-25
|
2KB
|
131 lines
#define NIL 0L
void DoOSErrorAlert(Str255, Str255);
void OutLineButton(DialogPtr, int);
void OSError(Str255, Str255);
void OSError2(Str255, Str255, OSErr);
void PstringCopy(char *, char *);
void PstringCat(char *, char *);
void Wait(void);
int stcisn(char *, char *);
void OutLineButton(theDialog, itemNo)
DialogPtr theDialog;
int itemNo;
{
int itype;
Rect buttonRect;
Handle aHandl;
GrafPtr tempPort;
GetPort(&tempPort);
SetPort(theDialog);
GetDItem(theDialog, itemNo, &itype, &aHandl, &buttonRect);
PenSize(3,3);
InsetRect(&buttonRect, -4, -4);
FrameRoundRect(&buttonRect, 16, 16);
PenSize(1,1);
SetPort(tempPort);
}
void OSError(msg1, msg2)
Str255 msg1, msg2;
{
short i;
if (msg2)
ParamText(msg1, msg2, "\p", "\p");
else
ParamText(msg1, "\p", "\p", "\p");
i = StopAlert(600, NIL);
}
void OSError2(msg1, msg2, theErr)
Str255 msg1, msg2;
OSErr theErr;
{
short i;
Str255 aString;
NumToString((long)theErr, &aString);
if (msg2)
ParamText(msg1, msg2, aString, "\p");
else
ParamText(msg1, NIL, aString, "\p");
i = StopAlert(600, NIL);
}
void DoOSErrorAlert(mess1, mess2)
Str255 mess1, mess2;
{
ParamText(mess1, mess2, "\p", "\p");
StopAlert(600, NIL);
}
void PstringCopy(to, from)
char *to, *from;
{
char *end = from + *from + 1;
for ( *to++ = *from++; from < end; )
*to++ = *from++;
}
void PstringCat(to, from)
char *to, *from;
{
register int i, length;
char *p;
length = *from;
p = to + *to + 1;
from++;
for ( i = 0; i < length; i++) *p++ = *from++;
*to += length;
}
void Wait()
{
long HowLong;
long fTicks;
HowLong = 120L;
Delay(HowLong, &fTicks);
}
/*-------------------------------------------------------------------------------*/
int stcisn(s, set)
register char *s;
char *set;
{
register char *t;
register int count = 0;
/* find position of set in s */
while (*s)
{
t = set;
while (*t && (*s != *t)) t++;
if (!*t)
{
s++;
count++;
}
else
break;
}
return (count);
}